package com.atguigu.gulimail.member.service.nacosprovider;

import com.atguigu.common.service.member.OrderMemberService;
import com.atguigu.common.utils.R;
import com.atguigu.gulimail.member.dao.MemberReceiveAddressDao;
import com.atguigu.gulimail.member.entity.MemberReceiveAddressEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author fangy
 * @date 2022-10-16 23:18
 */
@DubboService
public class OrderMemberServiceImpl implements OrderMemberService {


    @Autowired
    MemberReceiveAddressDao memberReceiveAddressDao;

    @Override
    public R getAddress(Long MemberId) {

        List<MemberReceiveAddressEntity> memberReceiveAddressEntities = memberReceiveAddressDao.selectList(new QueryWrapper<MemberReceiveAddressEntity>().eq("member_id", MemberId));

        return R.ok().setData(memberReceiveAddressEntities);
    }
}
